2 - Computergraphik [ID:12106]
50 von 1044 angezeigt

Welcome for our lecture computer graphics.

We had a brief start on Monday by having a short introduction to images.

How does an image look like?

I told you that in our context for us an image is just a 2D array of pixel values and every pixel can be just a single bit maybe that tells us whether the pixel is black or white.

Or the normal case is that it's an RGB triple describing the color of a pixel.

And we were also looking into what I call frame buffer. So that means the frame buffer usually is just the current image we are rendering and this frame buffer is often displayed in a window.

So when we render into that frame buffer, we can directly see the result on a window.

And later on this window can be stored off as a normal image file.

Or it can just be displayed like in a computer game, for instance.

And today now we want to look into how we can generate such 2D graphics more easily and how that really works in practice.

And we will introduce a number of concepts of computer graphics, including that we will have a first look into transformations.

That's geometric descriptions, how we can move objects in a scene and translate them and rotate them and stuff like that.

OK, so as I said last time, I told you what we call rendering means that we fill a frame buffer with shapes, with text, with 3D content later on.

Now, like in a computer game, when you have a 3D world and an image of the 3D world is generated and rendered into a frame buffer, that's what we call rendering.

And in fact, rendering is a kind of sub-discipline of computer graphics, but it's the core of computer graphics.

And this is what we will mainly look into in this lecture.

And last week, not last week on Monday, I've shown you a simple example how to render a rectangle, for instance.

That was very simple. We had a nested loop and filled all pixels from Xmin to some Xmax and Ymin to Ymax.

That was very simple to enumerate all the pixels within a rectangle, at least as long as the rectangle is axis aligned and not rotated.

In the exercises, you should look into how to render a circle.

That's already a little bit more complicated.

You have to think about a simple algorithm to enumerate all the pixels within a circle.

Here, the circle is defined by its radius and its center.

Another interesting problem that we will look into next week is how to rasterize or how to render a line.

So assume you have here our image and we have two arbitrary points and now enumerate all the pixels along a line between these two points.

This is what we will look into next week.

Or how to enumerate all the pixels within a triangle, an arbitrary triangle.

How can we find all the pixels within a triangle?

This is also what we will look into next week.

And here we will look into the algorithms to do that.

These algorithms we call rasterization algorithms because they sort of rasterize different single primitives.

Next week we will look into the algorithms.

But today we will look into libraries that are available to do that for you.

Because of course in a computer game or if people program computer games they don't start by programming algorithms for rasterizing lines.

Because that's well understood and there are libraries available that do so.

And I will give you a brief overview of these, of such libraries or graphics APIs more general today.

Because we can introduce interesting concepts and you can quickly then experiment with that.

But in fact these APIs are not the core of this lecture.

So you will learn about these APIs a little bit in parallel.

But in this lecture we mainly look at the underlying algorithms.

So the goal of this lecture is not to teach you different OpenGL and DirectX and WebGL and whatsoever.

But yeah to teach the algorithms behind that.

And yeah but to learn that we will look into these graphics APIs.

Okay for the APIs in general there are two different classes of APIs.

The first one are command based APIs.

That means these APIs are libraries that provide methods or functions that do some rendering tasks.

That for instance rasterize a line from a starting point to an end point.

That would be a function rasterize line x1 y1 x2 y2 and then this line for instance is rasterized.

And to generate your image you have several lines and whatever simple primitives.

And you send commands to draw these single primitives using these commands.

Teil einer Videoserie :

Zugänglich über

Offener Zugang

Dauer

01:32:50 Min

Aufnahmedatum

2019-10-17

Hochgeladen am

2019-10-29 14:39:27

Sprache

de-DE

Einbetten
Wordpress FAU Plugin
iFrame
Teilen